Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate dapp-offer-up history to dapp-agoric-basics (WIP) #3

Closed
wants to merge 93 commits into from

Conversation

dckc
Copy link
Member

@dckc dckc commented Jan 31, 2024

I wonder about having this repository subsume https://github.com/Agoric/dapp-offer-up .

For the 4-panel dapp, we can either use a different ui/ directory and more files under contract/... but that doesn't expose the 2 things via yarn create @agoric/dapp .... So perhaps the 4-panel thing should be a separate branch: --dapp-branch offer-up vs --dapp-branch basics.

Meanwhile, dapp-offer-up has a significant issues list and some pending PRs. So renaming it to dapp-agoric-basics is probably better than this approach.

dckc and others added 30 commits September 29, 2023 22:15
 - fix: build xsnap
darn... I didn't keep the error message around
 - ignore generated core-eval, bundles
 - start:docker, docker:logs, docker:bash, docker:make, docker:help
 - agd cheat-sheet in the form of a Makefile
> Docker Desktop for Mac with Apple Silicon can automatically emulate amd64 architecture on ARM64. When you try to run an image that is not available for ARM64, Docker Desktop uses Rosetta 2 to emulate an AMD64 CPU.

Co-authored-by: 0xPatrick <[email protected]>
 - lint: @endo/eslint-plugin etc.
 - test: @endo/ses-ava, @agoric/zoe, ...
 - babel resolutions for override mistake
 - reduce dependencies to those used in the contract
 - never mind dappConstants
 - endo issue 1235 is fixed
 - name, version, license
 - private
 - workspaces
 - babel resolutions for override mistake
 - basic scripts
0xpatrickdev and others added 21 commits January 3, 2024 16:19
- remove explicit lin-jessie command, as @agoric/eslint-config extends eslint-config-jessie
- use lint:fix in favor of lint-fix
- use 'resolutions' to ensure only one version of each package is installed
- remove babel resolutions (fe only) from contract package.json
- confirmed changes via 'find ./node_modules -type d -name 'endo''
- currently, the contract is built in the docker container. this change allows the consumer to build the contract outside the docker container, or in ci
fix: contract bundles have duplicate dependencies
fix: ensure agd tx swingset install-bundle uses gas-adjustment 1.2
* fix: lower bundle storage cost to 0.02 IST / Kb like mainnet

Minting IST can't be skipped altogether; we still need _some_.
But we can mint just 100 and only 1 time, rather than 4k several
times.

* refactor: compute bundle cost param-change dynamically
- rename build-game1-start
 - strike "game" from test-contract.js, CONTRIBUTING.md
 - update repo URLs - strike "game"
 - strike "game" from package names
 - avoid "game" in contract filename
 - rename contract instance, brand, keywords
 - avoid "game" in ui, incl invitation maker
 - add comments to clarify the control flow etc.,
   - note our `no-use-before-define` convention (in prose)
   - cite zoe overview walkthru of this code
   - cite Hardened JS docs
 - feat: hoist maxItems to default from terms instead of hard-coded
 - use atomicRearrange() instead of deprecated reallocate()
   rather than try to explain
 - validate contract terms with patterns
 - refactor bagValueSize() into sum() and bagCounts()
   - set off with "#region bag utilities"
 - punt trace() rather than explain
fix: document contract; refactor for clarity; use defensive patterns
@dckc dckc changed the title chore: migrate dapp-offer-up history to dapp-agoric-basics chore: migrate dapp-offer-up history to dapp-agoric-basics (WIP) Jan 31, 2024
@LuqiPan
Copy link
Collaborator

LuqiPan commented Feb 6, 2024

Hey @dckc, following the discussions in the extended docs revamp standup this morning, would it make sense if I just work on polishing this PR and get it merged in?

My planned course of actions:

  1. switch the mentions of offer-up in this repo to agoric-basics
  2. remove the UI code and test for now while the goals for UI are being planned and focus on contract code first

@dckc
Copy link
Member Author

dckc commented Feb 6, 2024

finishing this would be one way to do it, but I don't know that the history adds much value.

I suggest we start this app just like creating your dapp section of Getting Started tells our audience to create theirs:

yarn create @agoric/dapp --dapp-template dapp-offer-up dapp-agoric-basics

remove the UI code and test for now while the goals for UI are being planned and focus on contract code first

I don't object, but I don't see why we would remove it. We'll want tests for the dapp-agoric-basics UI, right?

@0xpatrickdev
Copy link
Member

but I don't know that the history adds much value

Agree. Maybe we make this change (or something like it) upstream to provide more info in the initial commit message?

diff --git a/packages/agoric-cli/src/init.js b/packages/agoric-cli/src/init.js
index e2e3a0b51..95c28f095 100644
--- a/packages/agoric-cli/src/init.js
+++ b/packages/agoric-cli/src/init.js
@@ -50,6 +50,9 @@ export default async function initMain(_progname, rawArgs, priv, opts) {
     throw Error('cannot clone');
   }

+  const commitHash = await pspawn('git', ['rev-parse', 'HEAD'], {
+    cwd: DIR,
+  });
   await pspawn('rm', ['-rf', '.git'], { cwd: DIR });
   await pspawn('git', ['init'], { cwd: DIR });

@@ -78,7 +81,11 @@ export default async function initMain(_progname, rawArgs, priv, opts) {
   await pspawn('git', ['add', '.'], { cwd: DIR });
   await pspawn(
     'git',
-    ['commit', '-m', `chore: agoric init ${DIR}\n\nImported from ${dappURL}`],
+    [
+      'commit',
+      '-m',
+      `chore: agoric init ${DIR}\n\nImported from ${dappURL}\nCommit: ${commitHash}`,
+    ],
     {
       cwd: DIR,
     }

@dckc
Copy link
Member Author

dckc commented Feb 7, 2024

That seems like a reasonable enhancement to the agoric cli, but to make use of it in yarn create ... involves waiting for it to get into a release.

Adding more info to the initial commit is a fine idea, and we can do that with git commit --amend and no waiting, right?

@dckc
Copy link
Member Author

dckc commented Feb 7, 2024

btw... the history would be of value if we're actually merging dapp-offer-up and dapp-agoric-basics into one app. But (a) I don't think I have convinced the team on that one, and (b) in that case, it would make more sense to just rename the dapp-offer-up repo.

@LuqiPan LuqiPan mentioned this pull request Feb 7, 2024
@dckc
Copy link
Member Author

dckc commented Feb 8, 2024

obsolete in favor of #6

@dckc dckc closed this Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants